package cn.kgc.tangcco.config;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Enumeration;

/**
 * @author 李昊哲
 * @Description
 * @create 2020/10/15 下午4:44
 */
public class ServletConfig03 extends HttpServlet {
    private static final long serialVersionUID = -2247044309633611423L;

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("config03爱的轰轰烈烈");
        ServletConfig config = this.getServletConfig();
        Enumeration<String> names = config.getInitParameterNames();
        while (names.hasMoreElements()) {
            System.out.println("config03获取参数" + config.getInitParameter(names.nextElement()));
        }
    }
}
